home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.3 Development Libraries
/
SGI IRIX 6.3 Development Libraries.iso
/
dist
/
dist6.3
/
gl_dev.idb
/
usr
/
include
/
gl
/
kb.h.z
/
kb.h
Wrap
C/C++ Source or Header
|
1996-12-06
|
3KB
|
91 lines
#ifndef __GL_KB_H__
#define __GL_KB_H__
/**************************************************************************
* *
* Copyright (C) 1987, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
/*
* kb.h
*
* $Revision: 1.3 $
*/
#ifndef NULL
#define NULL 0
#endif
/* constants for the iris keyboard */
#define KB_BEEPCMD 0x00 /* low bit clear --> beep commands */
#define KB_LEDCMD 0x01 /* low bit set --> led commands */
#define KB_RESET 0x10 /* reset the keyboard */
#define KB_REPLY 110 /* first byte of reply from keyboard
* after reset - second is read from
* DIP switches
*/
/* beep commands */
#define KB_NOCLICK 0x08 /* disable click */
#define KB_AUTOREPEAT 0x80 /* enable autorepeat */
#define KB_SHORTBEEP 0x02 /* do a short beep */
#define KB_LONGBEEP 0x04 /* do a long beep */
/* led commands */
#define LAMP_NUMLOCK 0x01
#define LAMP_CAPSLOCK 0x02
#define LAMP_SCROLLLOCK 0x04
#define LAMP_L1 0x08
#define LAMP_L2 0x10
#define LAMP_L3 0x20
#define LAMP_L4 0x40
/* predefined shift state bits */
#define KB_STATE_SHIFT 0x0001
#define KB_STATE_CTRL 0x0002
#define KB_STATE_ALT 0x0004
/* predefined special shift states (never used as shift state bits) */
#define KB_STATE_CAPSLOCK 0x0100
#define KB_STATE_META_BIT8 0x0200
#define KB_STATE_META_ESC 0x0400
/* values for t_type */
#define KB_TABLECODE 1
#define KB_SEQ_TABLE 2
#define KB_SEQ_FUNC 3
/* defaults */
#define KB_BEEPDEFAULT (KB_BEEPCMD | KB_NOCLICK | KB_AUTOREPEAT)
#define KB_LEDDEFAULT KB_LEDCMD
/* values for sd_kstate */
#define KB_DEPRESSED 0x01 /* shift key depressed */
#define KB_LOCKED 0x02 /* shift key locked */
/* convert scancode from keyboard into keycode and up/down value */
#define KB_SCANCTOKEYC(c) ((c) & 0x7f)
#define KB_SCANCTOUPDN(c) (!((c) & 0x80))
/* map keycode to GL device */
#define KB_DEVOFF1 1
#define KB_DEVOFF2 60
#define KB_KEYCTODEV(c) ((((c) + KB_DEVOFF1) <= MAXKBDBUT) \
? ((c) + KB_DEVOFF1) \
: ((c) + KB_DEVOFF2))
/* map device to keycode */
#define KB_DEVTOKEYC(d) ((d) - ((ISXKEYBD(d))?KB_DEVOFF2:KB_DEVOFF1))
/* out-of-bounds values generated by keys that gl_kbtrans() doesn't translate */
#define KB_OOB_BREAK 0xff00
#define KB_OOB_SETUP 0xff01
#define KB_OOB_NOSCRL 0xff02
#endif /* !__GL_KB_H__ */